/* -----------------------------------------------------------------------------
*  CString
*  Author: Antonio Javier Gallego Sánchez (ajgallego AT gmail DOT com)
*  License: GNU Public License
* ----------------------------------------------------------------------------*/

#ifndef CSTRING_HPP_
#define CSTRING_HPP_

#include <string>
using namespace std;

class CString
{
    public:
        static const char* vectorToString( const class CVectorString *strList, char separator );

        static const char* stringToLower( const char* str );
        static const char* stringToUpper( const char* str );

        static int charToInt( char c );
        static string charToString( char c );

        static string intToString( int value );
        static string floatToString( float value );
        static string doubleToString( double value );

        static bool stringToInt( const char* str, int *num );
        static bool stringToFloat( const char* str, float *num );
        static bool stringToDouble( const char* str, double *num );
        static bool stringToHex( const char* str, int *num );
        static bool stringToOct( const char* str, int *num );

        static bool isInteger( const char* str );
        static bool isFloat( const char* str );


        static string getSuffix( const string &str, unsigned int numChars );
        static string getPreffix( const string &str, unsigned int numChars );

        static void substChar( string *text, char c1, char c2 );

        static string trim( const string &str );
        static string leftTrim( const string &str );
        static string rightTrim( const string &str );
};

#endif